//==================================================================
/// MathUtills.cpp
///
/// Created by Davide Pasca - 2009/10/8
/// See the file "license.txt" that comes with this project for
/// copyright info. 
//==================================================================

#include "stdafx.h"
#include "MathUtills.h"

//==================================================================
namespace Math
{

//==================================================================
static u_int _g_m_w = 111;
static u_int _g_m_z = 222;

//==================================================================
u_int RandomU32()
{
    _g_m_z = 36969 * (_g_m_z & 65535) + (_g_m_z >> 16);
    _g_m_w = 18000 * (_g_m_w & 65535) + (_g_m_w >> 16);
    return (_g_m_z << 16) + _g_m_w;
}

//==================================================================
float Random()
{
	U32 val = RandomU32();

	return (float)(val & 0xfffff) / 0x100000;
}

//==================================================================
}
